import request from '@/router/axios';

export const getProList = (releaseStatus,typeId, current, size,query) => request({  // 请求列表
  url: '/api/blade-product/product/page',
  method: 'get',
  params: {
    releaseStatus,
    typeId, // 分组id
    current,
    size,
    query,
  }
})

export const exportProduct = () => request({  // 请求列表
  url: '/api/blade-product/product/export',
  method: 'get'
})

export const productDetails = () => request({  // 查询产品规格详情-列表
  url: '/api/blade-product/tProductSpec/list',
  method: 'get'
})

export const getleftMenu = () => request({ // 树形结构
  url: '/api/blade-product/tProductType/tree',
  method: 'get'
})

export const addProduct = (form) => request({ // 新增产品
  url: '/api/blade-product/product',
  method: 'post',
  data:form
})

export const modifyProduct = (form) => request({ // 修改产品
  url: 'api/blade-product/product',
  method: 'put',
  data:form
})

export const removeNode = (id) => request({ // 删除节点
  url: `api/blade-product/tProductType/physical/${id}`,
  method: 'delete'
})

export const updateNode = (form) => request({ // 重命名
  url: `api/blade-product/tProductType`,
  method: 'put',
  data: form
})

export const removeProduct =(productIdList) => request({ // 删除产品信息
  url: `api/blade-product/product`,
  method: 'delete',
  data: productIdList,
})

export const getProductDetails =(productId) => request({ // 查询产品详情
  url: `api/blade-product/product/${productId}`,
  method: 'get'
})


export const addGroupNode =(from) => request({ // 保存分组节点
  url: `api/blade-product/tProductType`,
  method: 'post',
  data: from
})

export const moveNode =(moveId, type) => request({ // 移动分组节点
  url: `api/blade-product/tProductType/sort/${moveId}/${type}`,
  method: 'put'
})

export const fiexdItem =(productId, type) => request({ // 产品置顶
  url: `api/blade-product/product/fixed/${type}/${productId}`,
  method: 'put'
})
export const putIntel =(data,up) => request({ // 发布到官网
  url: `api/blade-product/product/release/${up}`,
  method: 'post',
  headers:{
    "Content-Type":"application/json"
  },
  data:JSON.stringify(data)
})
//获取 产品编码
export const getProCode =() => request({ // 移动分组节点
  url: 'api/blade-product/product/create/productCode',
  method: 'get'
})
